const json = '{"a":[{"b":"c"},"d"],"x":1}'
function getValue(json, target) {
    let finValue = JSON.parse(json)
    const stringList = target.split('.')
    for (let i = 0; i < stringList.length; i++) {
        if (stringList[i].indexOf('[') > -1) {
            const newList = stringList[i].split('[')
            for(let j=0; j < newList.length;j++){
                let key = newList[j].indexOf(']') > -1 ? newList[j].split(']')[0] : newList[j]
                finValue = finValue[key]
            }
        } else {
            finValue = finValue[stringList[i]]
        }
    }
   return finValue
}
console.log(getValue(json, 'a[0].b'));